package com.yudean.esb.dao.erp;

import com.yudean.esb.domain.erp.ErpIdsInsDangerType;
import com.yudean.esb.mapper.erp.ErpIdsInsDangerTypeMapper;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by zenghui on 2015-05-19.
 * desc:
 */
@Repository("ErpIdsInsDangerTypeDao")
@Scope("prototype")
public class ErpIdsInsDangerTypeDao {
    private static final String TAG = "ErpIdsInsDangerTypeDao";
    @Resource
    private ErpIdsInsDangerTypeMapper erpIdsInsDangerTypeMapper;

    public int insert(ErpIdsInsDangerType erpIdsInsDangerType) throws Exception {
        return erpIdsInsDangerTypeMapper.insert(erpIdsInsDangerType);
    }

    public void deleteDangerType(String insTypeCode) throws Exception {
        erpIdsInsDangerTypeMapper.delete(insTypeCode);
    }

    public void insertBatch(List<ErpIdsInsDangerType> dangerTypeList) {
        if (null == dangerTypeList || 0 == dangerTypeList.size() ) {
            return;
        }
        erpIdsInsDangerTypeMapper.insertBatch(dangerTypeList);
    }


}
